In recent years, digital cameras has captured the market of cameras. Although the quality and the price are considered, consumers are more concerned about the quality of the pictures. White balance is one of the factors used to improve the quality of the pictures. The current white balance methods are incompetent to handle all possible situations in the captured scene.
Whenever a scene is captured by a digital camera, every pixel value of the recorded scene depends upon the three-sensor response which is affected by the illuminant of that scene. As an effect, a distinct color cast appears over the captured scene. Such an effect of the light source remaining on the recorded image is due to a color temperature of the corresponding light source. When a white object is illuminated with a low color temperature light source, the object in the captured image has a reddish color. Similarly, if the white object is illuminated with a high color temperature light source, the object in the captured image has a bluish color. For developing a new white balance algorithm, it is necessary to render the information about the illuminant of the scene.
The color difference caused by the “color constancy” of a human eye in different light sources can not be distinguished by the human vision. The Colors remain constant through recognition despite they are viewed under different light sources. The mechanism employed in a digital camera to compensate the color difference caused by various light sources is white balance.
Gray World Method (GWM)
Gray world assumption states that a given image with a sufficient amount of color variations is provided, then the average value of the RED, GREEN, and BLUE components of the image will be averaged into a common gray-value. By gray world method, the average reflectance value of every visible surfaces in all scenes are assumed to be gray so as to estimate the spectral distribution of the illuminants. This method is implemented by taking an image and scaling the red, green and blue color components of the image in order to maintain the assumption of the gray world method.
Perfect Reflector Method (PRM)
Perfect reflector method assumes that the RGB values of the “brightest” pixel in an image captured by a digital camera is taken to be the glossy or specular surface. For any white balancing algorithm, it is the most important to gather the information about all surfaces and the illuminant in the scene. PRM focuses on an item constructed by underlining the presence of “specularity” or the glossy surfaces in an image. The specularity is helpful to convey a good amount of the information about the illuminant. The specularities or glossy surfaces reflect the actual color of the light source as these specularities have constant reflectance functions over a wide range of wavelengths. By detecting the specularities, it is easy to find out the actual color of the light source and further to eliminate the influence of the illuminant in the scene. This method exploits the perfect reflector settings to correct the image. It also locates the reference white point by finding the pixel with the greatest luminance value and performs a white balance adjustment according to the reference white point.
FUZZY Rules Method (FRM)
In FRM (Y. C. Cheng, W. H. Chan, and Y. Q. Chen, “Automatic White Balance for Digital Still Camera,” EEEE Transactions on Consumer Electronics, Volume 41, pp. 460-466, 1995), the image is converted from the RGB color space to the YCrCb color space so that the color's characteristics in the YCrCb color space for the white balance adjustment is presented. A image is divided into 8 segments by FRM to achieve a more precise white balance.
Please refer to FIG. 1, which is a diagram showing different deviations of the lights with different color temperatures. In FIG. 1, “A” represents the deflected direction of the light with a higher color temperature, and “B” represents the deflected direction of the light with a lower color temperature. The experimental figure shows some results as follows:
(a) Compared to a brighter color, a darker color has a less deviation from nominal position under different light sources. The deviation is significant on Cr and Cb components.
(b) When a white color is illuminated with different light sources, the ratio of Cr to Cb will be approximately between −1.5 to −0.5.
(c) At high luminance, the color components are easy to be saturated; while at low luminance, the color components become colorless.
According to the above-mentioned experimental results, the fuzzy rules can be concluded as follows:
(i) The averages of Cr and Cb for each segment will be weighted with smaller values under the conditions of higher and lower illuminations in order to avoid being saturated and being colorless.
(ii) The averages of Cr and Cb for each segment of darker colors are weighted less than brighter colors.
(iii) When a large object or background occupies more than one segment, its color will dominate the segment. The Cr to Cb ratios of adjacent segments will be similar. The given weightings of those segments with a uniform chromatic color will become smaller in order to avoid over-compensation on the color of the image.
If the Cr to Cb ratio of the segment is approximately between −1.5 to −0.5, the probability of becoming a white region increases and the given weightings becomes the greatest.
Besides these basic methods, Chiou's white balance method (T. S. Chiou, “Automatic White Balance for Digital Still Camera,” Master Thesis, Department of Computer Science and Information Engineering, National Taiwan University, Taiwan, 2000) has also been provided. In his method, Chiou tries to overcome the drawbacks of the basic methods.
Chiou's White Balance Method (CWBM)
Please refer to FIG. 2, which is a block diagram of Chiou's white balance method. CWBM is composed of three units: a white point detecting unit, a white balance judging unit and a white balance adjusting unit.
In the white point detecting unit, the reference white points are detected. Firstly, the rough reference white pixels are detected. Then the image is converted from the RGB color space to the YCrCb color space, and the pixels satisfying the Equation 1.1 are picked up.√{square root over (Cr2+Cb2)}≦CHth  (1.1)
The threshold value CHth is set in 60 in the experiment. √{square root over (Cr2+Cb2)} is the chromaticity value.
Secondly, the pixels satisfying the Equation 1.2 among the rough reference white pixels are selected as precise reference white pixels.R≧Rth, G≧Gth, B≧Bth |Cr|≦ABr, |Cb|≦ABb Rl≦Cr/Cb≦Ru  (1.2)
Rth, Gth, and Bth are the threshold value picked up from the eightieth percentile of each component histogram. ABr (=45), ABb (=45) are the absolute values of Cr, Cb respectively. Rl (=−1.25), Ru (=−0.75) are the lower and upper range of the Cr to Cb ratio.
Finally, the averages of rough reference white pixels and precise reference white pixels are calculated as (Rr, Gr, Br) and (Rp, Gp, Bp) respectively.
The white balance judging unit judges whether or not to apply the white balance on the desired image then choose the reference white point data from the white point detecting unit. Firstly, Rrough and Rprecise are calculated, wherein Rrough is the ratio of rough reference white pixels to all pixels of the image and Rprecise is the ratio of precise reference white pixels to all pixels of the image. Secondly, Rrough is determined if it is greater than or equal to Rprecise and defined as a prescribed proportion, which is 0.2 in the experiment. Then Rprecise is determined if it is greater or equal to Pprecise and defined as another prescribed proportion, which is 0.05 in the experiment. Finally, a mode Ma which shows the flow of CWBM is set in the value 0, 1 and 2 as shown in FIG. 3.
The white balance adjusting unit adjusts the white balance according to the mode Ma. The rough reference white point (Rrgain, Grgain, Brgain) or the precise reference white point (Rpgain, Gpgain, Bpgain) is calculated to obtain the scale factors. If Ma is set in the value 2, then white balance is adjusted according to the precise reference white point (Rpgain, Gpgain, Bpgain). If Ma is set in the value 1, then the minors between (Rrgain, Grgain, Brgain) and (Rpgain, Gpgain, Bpgain) is chosen. However, no white balance adjustment is applied if Ma is set in the value 0.
For adjusting the extreme scale factors towards acceptable values, a sigmoid function shown in Equation 1.3 is used.Y=1.05*(1+tan h(X−1.25))+0.4  (1.3)
In Equation 1.3, X is an original scale factor and Y is an adjusted scale factor.
Although the above-mentioned GWM, PRM, FRM, and CWBA methods are provided. Some problems still can not be avoided. The most serious problem is the bad consistency of colors in the image resulting from the adjusted white balance.
It is therefore attempted by the applicant to deal with the above situation encountered in the prior art.